//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//********************************************************* 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Microsoft.TridentWordAddIn.Common
{
    /// <summary>
    /// Connection Parameters for SQL Connection
    /// </summary>
    public class TridentSqlConnectionParameters : DomainBase
    {
        /// <summary>
        /// Gets or sets the name of the server.
        /// </summary>
        /// <value>The name of the server.</value>
        public string ServerName { get; set; }

        /// <summary>
        /// Gets or sets the name of the user.
        /// </summary>
        /// <value>The name of the user.</value>
        public string UserName { get; set; }

        /// <summary>
        /// Gets or sets the password.
        /// </summary>
        /// <value>The password.</value>
        public string Password { get; set; }

        /// <summary>
        /// Gets or sets the name of the database.
        /// </summary>
        /// <value>The name of the database.</value>
        public string DatabaseName { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is trusted.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is trusted; otherwise, <c>false</c>.
        /// </value>
        public bool IsTrusted { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is encrypted.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is encrypted; otherwise, <c>false</c>.
        /// </value>
        public bool IsEncrypted { get; set; }

        /// <summary>
        /// Determines whether the specified <see cref="T:System.Object"></see> is equal to the current <see cref="T:System.Object"></see>.
        /// </summary>
        /// <param name="compareTo">The compare to.</param>
        /// <returns>
        /// true if the specified <see cref="T:System.Object"></see> is equal to the current <see cref="T:System.Object"></see>; otherwise, false.
        /// </returns>
        public bool Compare(TridentSqlConnectionParameters compareTo)
        {
            if (this.DatabaseName.CompareIgnoreCase(compareTo.DatabaseName) &&
                this.ServerName.CompareIgnoreCase(compareTo.ServerName) &&
                this.UserName.CompareIgnoreCase(compareTo.UserName))
            {
                return true;
            }

            return false;
        }
    }
}
